package com.zhuge_new.Adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by lenovo on 2018-09-15.
 */

public class FragmentsAdapter extends FragmentStatePagerAdapter {

    private List<Fragment> listFragments;



    public FragmentsAdapter(FragmentManager fm, List<Fragment> listFragments) {
        super(fm);
        this.listFragments=listFragments;
    }

    @Override
    public Fragment getItem(int position) {
        return listFragments.get(position);
    }

    @Override
    public int getCount() {
        return listFragments==null?0:listFragments.size();
    }
}